home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / LCLINT-D.SPK / lclint / guide / list.c < prev    next >
C/C++ Source or Header  |  1996-08-26  |  394b  |  27 lines

  1. typedef /*@null@*/ struct _list
  2. {
  3.   /*@only@*/ char *this;
  4.   /*@null@*/ /*@only@*/ struct _list *next;
  5. } *list;
  6.  
  7. extern /*@out@*/ /*@only@*/ void *
  8.   smalloc (size_t);
  9.  
  10. void
  11. list_addh (list l, /*@only@*/ char *e)
  12. {
  13.   if (l != NULL)
  14.     {
  15.       while (l->next != NULL) 
  16.     {
  17.       l = l->next;
  18.     }
  19.       
  20.       l->next = (list) smalloc (sizeof (*l->next));
  21.       l->next->this = e;
  22.     }
  23. }
  24.  
  25.   
  26.       
  27.